﻿using System.Windows;
using HtmlAgilityPack;
using System.Text;


namespace NetWorkDataCapture
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }



        private void kaishipiliangzhuaqu_Click_1(object sender, RoutedEventArgs e)
        {
            function1 abc = new function1();
            abc.httphelpertest("http://news.163.com");
        }

        private void zhuaquyulan_Click(object sender, RoutedEventArgs e)
        {
            function1 abc = new function1();
            HtmlNodeCollection node= abc.httphelpertest(getRules.getHtmlUrl);
            string[] str = new string[node.Count];
            int i = 0;
            foreach (HtmlNode singlenode in node)
            {
                str[i]=(singlenode.GetAttributeValue("href", "Not Found"));
                yulanshuju.AppendText(str[i]+"\r\n");
                i++;
            }
            
        }
    }
}
